<!--<link rel="stylesheet" href="css/colorbox.css" />-->
<html>
    <body>
        <div id="main">
            <div id="content">
                <div id="masthead">
                    <span class="head">Modificar Contraseña</span>
                    <ul class="breadcrumbs">
                        <li> 
                            <?php
                            if ($this->session->userdata('tipo') == 1) {
                                echo "Administrador";
                            } else if ($this->session->userdata('tipo') == 2) {
                                echo "Jefe";
                            }else
                                echo "Usuario";
                            ?> : 
                            Hola <?php echo $this->session->userdata('username'); ?></li>

                    </ul>
                </div>
                <!-- ENDS Headline -->
                <div id="page-content-full">
                    <h3>Cambiar Contraseña</h3>

                    <?php echo validation_errors(); ?>
                    <?php $attributes = array('id' => 'form');
                    echo form_open('configuraciones/set_password', $attributes)
                    ?>

                    <table>
                        <tr>
                            <td class =" etiqueta">Contrasena Anterior:&nbsp;</td>
                            <td class="campo">
                                <input type="password" size="20" id="old"/>
                            </td>
                        </tr>
                        <tr>
                            <td class =" etiqueta">Contrasena Nueva:&nbsp;</td>
                            <td class="campo">
                                <input type="password" size="20" id="new"/>
                            </td>
                        </tr>
                        <tr>
                            <td class =" etiqueta">Repita Contrasena:&nbsp;</td>
                            <td class="campo">
                                <input type="password" size="20" id="new1"/>
                            </td>
                        </tr>
                        <tr>
                            <td ><input type="submit" name="Submit" value="Guardar" id="cambiar"class="boton"/> </td>
                        </tr>


                    </table>
                    <br><br>
                    <div id="mensaje" style="color:red"></div>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="shadow-main"></div>
    </body>

    <script type="text/javascript">
        $('#cambiar').click(function(){
            var old = $("#old").val();
            var new0 = $("#new").val();
            var new1 = $("#new1").val();
            var msj;
            if(!old || !new0 || !new1){
                msj =1;
            }
            else 
                msj = 0;
            
            
            var form_data = {
                old: old,
                new0: new0,
                new1: new1,
                msj: msj, 
                ajax: '1'
            };
        
            $.ajax({
                url: $(this).attr('href'),//"<?php echo site_url('configuraciones/cambiar'); ?>",
                type: 'POST',
                data: form_data,
                success: function(msg){
                    $('#mensaje').html(msg);
                }
            
            });
            if(msj == 0)
                setTimeout('document.getElementById("form").reset();',1000);
            setTimeout('document.getElementById("info").innerHTML="";',4000);
            return false; 
        });    
    
    </script>

</html> 
